//
//  Service+UserService.h
//  CarService
//
//  Created by Nimo.Yu on 15/1/30.
//  Copyright (c) 2015年 lexingsoft. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ServiceManager.h"

static NSString *const kShareTypeTrainingOrder=@"TRAINING_ORDER";

/// 普通用户
static NSString *const kUserTypeCommonPeople = @"COMMONUSER";
/// 注册用户
static NSString *const kUserTypeRegisterPeople = @"REGISTERUSER";
/// 企业管理人员
static NSString *const kUserTypeEnterpriceManage = @"ENTERPRISE_MANAGER";
/// 企业服务人员
static NSString *const kUserTypeEnterpriceServer = @"ENTERPRISE_SERVER";


///中国移动
static NSString *const kOperatorCodeCMCC = @"10086";
///中国电信
static NSString *const kOperatorCodeChinaNet = @"10000";
///中国联通
static NSString *const kOperatorCodeChinaUnicom = @"10010";

///首页广告类型
/**
 * 首页（话费直充）
 */
static NSString *const kBannerTypeHOMEPAGE_HFZC = @"HOMEPAGE_HFZC";
/**
 * 首页（流量直充）
 */
static NSString *const kBannerTypeHOMEPAGE_LLZC = @"HOMEPAGE_LLZC";
/**
 * 首页（智能缴费）
 */
static NSString *const kBannerTypeHOMEPAGE_ZNJF = @"HOMEPAGE_ZNJF";
/**
 * 首页（流量屯包）
 */
static NSString *const kBannerTypeHOMEPAGE_LLTB = @"HOMEPAGE_LLTB";
/**
 * 发现（流量理财）
 */
static NSString *const kBannerTypeFIND_LLLC = @"FIND_LLLC";
/**
 * 发现（自由市场）
 */
static NSString *const kBannerTypeFIND_ZYSC = @"FIND_ZYSC";
/**
 * 发现（我的摊位）
 */
static NSString *const kBannerTypeFIND_WDTW = @"FIND_WDTW";
/**
 * 个人中心（抽奖转盘）
 */
static NSString *const kBannerTypePERSONAL_CENTER_CJZP = @"PERSONAL_CENTER_CJZP";
/**
 * 个人中心（常见问题）
 */
static NSString *const kBannerTypePERSONAL_CENTER_CJWT = @"PERSONAL_CENTER_CJWT";
/**
 * 个人中心（积分）
 */
static NSString *const kBannerTypePERSONAL_USER_SCORE = @"USER_SCORE";
/**
 * 个人中心（推荐码）
 */
static NSString *const kBannerTypePERSONAL_USER_INVITE_CODE = @"USER_INVITE_CODE";
/**
 * 个人中心（优惠券）
 */
static NSString *const kBannerTypePERSONAL_USER_COUPON = @"USER_COUPON";
/**
 * 签到（签到）
 */
static NSString *const kBannerTypeSIGN_IN = @"SIGN_IN";


//typedef NS_ENUM(NSUInteger, XHAddressViewType) {
//    XHAddressViewTypeDefault,
//    XHAddressViewTypeSelect,
//};

@interface ServiceManager(UserService)

/**
 *  自动登录
 *
 *  @param success 成功回调block
 *  @param failure 失败回调block
 */
+(void)autoLoginSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

/**
 *  验证码登录
 *
 *  @param phoneNum 手机号码
 *  @param passwd   密码
 *  @param code     短信验证码
 *  @param smsId    短信Id
 *  @param success  成功回调block
 *  @param failure  失败回调block
 */
+(void)loginFirstWithPhone:(NSString *)phoneNum passwd:(NSString *)passwd code:(NSString *)code smsId:(NSString *)smsId originalInviteCode:(NSString*)originalInviteCode success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *failure)) failure;

/**
 *  发送短信验证码(注册)
 *
 *  @param phoneNum 手机号码
 *  @param success  成功回调block
 *  @param failure  失败回调block
 */
+(void)getMessageCodeWithPhone:(NSString *)phoneNum success:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

///登录
+ (void)loginWithPhone:(NSString*)phoneNum passWord:(NSString*)passWord success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *failure)) failure;

///根据userID获取用户信息
+ (void)getUserInfoWithId:(NSString *)userId success:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

///获取用户信息
+ (NSDictionary *)getUserInfoSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

///更新用户信息
+ (void)refreshUserInfo:(NSDictionary *)userInfo success:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

///更新用户头像
+ (void)updateHeaderImage:(UIImage *)image success:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

///添加收货地址
+ (void)addAddress:(NSDictionary *)address success:(void(^)(NSDictionary * data)) success failure:(void(^)()) failure;

///删除收货地址
+ (void)deleteAddress:(NSString*)NBR success:(void(^)(NSDictionary * data)) success failure:(void(^)()) failure;

///更新收货地址
+ (void)upDateAddress:(NSDictionary *)address sequenceNBR:(NSString*)NBR success:(void(^)(NSDictionary * data)) success failure:(void(^)()) failure;

///查询收货地址
+ (void)readAddress:(NSDictionary *)address success:(void(^)(NSDictionary * data)) success failure:(void(^)()) failure;

///获取默认收货地址
+ (void)getDefaultAddressSuccess:(void(^)(NSDictionary * data)) success failure:(void(^)()) failure;

//查询当前用户借阅信息列表查询
+ (void)borrowBook:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data))success failure:(void(^)(NSDictionary *data)) failure;

///意见反馈
+ (void)sendReviewWithComment:(NSString *)comment success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///评价图书
+ (void)writeBookReviewWithComment:(NSString *)comment
                              book:(NSString *)bookId
                           orderSn:(NSString *)orderSn
                          targetId:(NSString *)targetId
                           success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///获取测试帐号
+ (void)getTestAcountInfoSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///订单分享成功回调
+ (void)orderShareEventWithDic:(NSDictionary *)dicData success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///分享成功回调
+ (void)shareEventWithDic:(NSDictionary *)dicData success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///查询虚拟账户信息
+ (void)getAccountInfoSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///查账单(分页)
+ (void)getAccountHistoryWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///充值
+ (void)addMoney:(double)amount withPayChannel:(NSString *)payChannel success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///获取充值方案
+ (void)getAddMoneySchemesSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;


///分享地址拼接
+ (NSString *)shareAddres:(NSString *)type sequenceNBR:(NSString *)NBR labelKey:(NSString *)labelKey;

///获取首页轮播广告
+ (void)getBannerAdvertisementsSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///修改手机号
+ (void)changePhone:(NSString*)phone code:(NSString*)code passWord:(NSString*)passWord smsId:(NSString *)smsId success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///初始化支付密码
+ (void)setupPayPassword:(NSString *)password success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///修改支付密码
+ (void)changePassWord:(NSString*)passWord code:(NSString *)code phone:(NSString*)phone smsId:(NSString *)smsId success:(void(^)(NSDictionary *data)) success failure:(void(^)())failure;

///公网用户签到
+ (void)signInSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data))failure;

///提交医生证信息
+ (void)submitDoctorInfo:(NSDictionary *)doctorDic success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data))failure;

///查询专家列表
+ (void)getAllDoctorWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///查询专家详情
+ (void)getDoctorInfoWithId:(NSString *)doctorId success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户查询自己的日记本
+ (void)getDiaryBookWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///查询用户账户信息
+ (void)getUserAccountInfoWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///判断用户提交认证医生
+ (void)isDoctorCertificationWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///判断推荐码是否有效
+ (void)isOrangeKeyWithSuccess:(NSString *)orangeKey success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///公网用户查询拿照之路
+ (void)getDirvingRoadInfoWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///公网用户获取个人二维码
+ (void)getUserTwoDimensionalCodeWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///查询练车记录
+ (void)queryTrainingCarsRecordWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取学车推荐码
+ (void)getStudentCarCodeWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取当前用户 推荐交定金 报名成功人数
+ (void)getUserSignUpNumberAndRecommendNumber:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///分页查询用户提现记录
+ (void)getUserWithdrawRecordWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///查询用户积分详情
+ (void)getUserIntegralDetailWithPageIndex:(NSUInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户提现
+ (void)postUserWithdrawalWithApplayType:(NSString *)applayType transferAccount:(NSString *)transferAccount transferName:(NSString *)transferName
outAmount:(NSString *)outAmount openBank:(NSString *)openBank success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data))failure;

///用户获取流量屯包
+ (void)getUserTrafficPackageWithType:(NSString*)type pageIndex:(NSInteger)pageIndex success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户获取提现银行
+ (void)getBankInfoWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///检测更新
+ (void)checkAppVersionSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取网络地址
+ (NSString *)getHostAddress;

///检测是否需要强制升级
+ (void)checkIsNeedForceUpdateSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取分享列表
+ (void)getShareListSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取用户购买包过险信息
+ (void)getUserBuyInsurance:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取教练教学时长
+ (void)getCocahWorkerInfoWithWordId:(NSString *)workId success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取学员各科目平均分数
+ (void)getStudentScottWithUserId:(NSString *)userId success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取评分统计信息
+ (void)getStudentCommentWithUserId:(NSString *)userId success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取客服电话
+ (void)getServicePhoneWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///上传注册信息
+ (void)postRegistrationInformationWithName:(NSString*)name phone:(NSString*)phone company:(NSString *)company department:(NSString*)department
                                 inviteCode:(NSString*)inviteCode success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///根据手机号码查询对应运营商信息
+ (void)getOperatorInfoWithMobile:(NSString *)mobile success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户下架自己的优惠券
+ (void)soldOutCouponsWithMarketSeq:(NSString*)marketSeq success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户购买优惠券
+ (void)userBuyCouponsWithPassWord:(NSString*)passWord amount:(NSString*)amount marketSeq:(NSString *)marketSeq success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取积分抵扣规则
+ (void)getScoreDeductionRuleSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取签到奖励规则
+ (void)getScoreInCouponSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///发布优惠券
+ (void)putawayCouponsWithCode:(NSString *)code salesPrice:(NSString*)salesPrice success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取提交令牌
+ (void)getSubmitTokenSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户使用流量屯包
+ (void)userTrafficPackageWithOrderSn:(NSString*)orderSn userCount:(NSString*)userCount phone:(NSString*)phone passWord:(NSString*)passWord
                        phoneLocation:(NSString*)phoneLocation submitToken:(NSString*)submitToken success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户查询流量包使用详情
+ (void)getTrafficePackageDetailWithOrderSn:(NSString*)orderSn success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取积分可以抵扣的金额
+ (void)getScore2MoneyWithPrice:(NSString *)price productType:(NSString *)productType success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户购买理财产品
+ (void)postUserBuyFinancialProductWithPassWord:(NSString*)passWord amount:(NSString *)amount payMethod:(NSString*)payMethod market:(NSDictionary*)market success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户查询我的理财流量
+ (void)getUserMoneyFlowWithPageIndex:(NSInteger)pageIndex type:(NSString*)type success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户获取字典表年化收益
+ (void)getDictionaryListWithSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户理财收益
+ (void)getUserFinancialBenefitsWithPageIndex:(NSInteger)pageIndex userId:(NSString*)usrId success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取智能缴费返还规则
+ (void)getBackRuleSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取提现最小金额
+ (void)getCashoutLimitSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///使用我的理财流量选择流量
+ (void)getSelectFinancialBenefitsTrafficWithOrderSn:(NSString*)orderSn success:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///用户使用基金流量产品
+ (void)userFinancialBenefitsWithPhone:(NSString*)phone
                         phoneLocation:(NSString*)phoneLocation
                         fundProductId:(NSString*)fundProductId
                           chargeCount:(NSString*)chargeCount
                               success:(void(^)(NSDictionary *data)) success
                               failure:(void(^)(NSDictionary *data)) failure;

///获取今天是否已经签到
+ (void)getIsSignTodaySuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///获取购买成功之后赠送的积分规则
+ (void)getBuyGiftsScoreSuccess:(void(^)(NSDictionary *data)) success failure:(void(^)(NSDictionary *data)) failure;

///测试验证码接口
+ (void)postMessageCodeWithPhone:(NSString *)phoneNum success:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;

///测试登录接口
+ (void)postLoginWithPhone:(NSString *)phone passWord:(NSString *)passWord success:(void(^)(NSDictionary *data)) success failure:(void(^)()) failure;


@end





